<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>个人信息</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
    <div class="main-content">
        <tags:breadcrumb menuId="用户信息" />
        <div class="page-content">
            <form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/info" method="post" class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">头像:</label>
                    <div class="col-sm-9">
                        <input type="hidden" name="photo" id="nameImage" />
                        <tags:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
                    </div>
                </div><hr>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">归属公司:</label>
                    <div class="col-sm-9">
                        <label class="lbl">${user.company.name}</label>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">归属部门:</label>
                    <div class="col-sm-9">
                        <label class="lbl">${user.office.name}</label>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">姓名:</label>
                    <div class="col-sm-9">
                        <form:input path="name" htmlEscape="false" maxlength="50" class="required col-md-5" readonly="true"/>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">邮箱:</label>
                    <div class="col-sm-9">
                        <form:input path="email" htmlEscape="false" maxlength="50" class="email"/>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">电话:</label>
                    <div class="col-sm-9">
                        <form:input path="phone" htmlEscape="false" maxlength="50"/>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">手机:</label>
                    <div class="col-sm-9">
                        <form:input path="mobile" htmlEscape="false" maxlength="50"/>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">备注:</label>
                    <div class="col-sm-9">
                        <form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">用户类型:</label>
                    <div class="col-sm-9">
                        <label class="lbl">${fns:getDictLabel(user.userType, 'sys_user_type', '无')}</label>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">用户角色:</label>
                    <div class="col-sm-9">
                        <label class="lbl">${user.roleNames}</label>
                    </div>
                </div>
                <hr/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">最后登陆:</label>
                    <div class="col-sm-9">
                        <label class="lbl">IP: ${user.loginIp}&nbsp;&nbsp;&nbsp;&nbsp;时间：<fmt:formatDate value="${user.loginDate}" type="both" dateStyle="full"/></label>
                    </div>
                </div>
                <div class="form-actions clearfix">
                    <div class="col-md-offset-2">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
                    </div>
                </div>
            </form:form>
        </div>
    </div>
</body>
</html>